package net.hn.hnms.biz.gasext.dws.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.hn.hnms.biz.gasext.dws.domain.dto.AlarmDetailDto;
import net.hn.hnms.biz.gasext.dws.domain.dto.DwdRydwHistoricalDataDto;
import net.hn.hnms.biz.gasext.dws.domain.dto.DwdRydwRealTimeDataDto;
import net.hn.hnms.biz.gasext.dws.domain.dto.MinePersonDataDto;
import net.hn.hnms.biz.gasext.dws.domain.vo.*;
import net.hn.hnms.biz.gasext.dws.service.DwdRydwService;
import net.hn.hnms.sys.common.core.domain.R;
import net.hn.hnms.sys.common.core.domain.ResponsePage;
import net.hn.hnms.sys.common.mybatis.core.page.PageQuery;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName RydwController
 * @Description
 * @Author halo
 * @Date 2024/8/28 11:24
 **/

@RestController
@RequestMapping("/personnelLocation")
@Api(tags = {"人员定位接口"})
public class RydwController {

    @Resource
    private DwdRydwService dwdRydwService;

    @GetMapping("getAlarmDetailList")
    @ApiOperation("根据查询条件查询报警明细")
    public R<ResponsePage<AlarmDetailVO>> getPageAlarmDetailList(PageQuery pageQuery, String companyCode, AlarmDetailDto alarmDetailDto) {

        ResponsePage<AlarmDetailVO> page = dwdRydwService.selectAlarmDetailList(pageQuery, companyCode, alarmDetailDto);
        return R.ok(page);
    }

    @GetMapping("getPageRealTimeDataList")
    @ApiOperation("查询人员定位实时数据")
    public R<ResponsePage<DwdRydwRealTimeDataVo>> getPageRealTimeData(PageQuery pageQuery, DwdRydwRealTimeDataDto dto) {

        ResponsePage<DwdRydwRealTimeDataVo> page = dwdRydwService.selectRealTimeDataList(pageQuery,dto);
        return R.ok(page);
    }
    @GetMapping("getPageHistoricalDataList")
    @ApiOperation("查询人员定位历史数据")
    public R<ResponsePage<DwdRydwHistoricalDataVo>> getPageHistoricalData(PageQuery pageQuery, DwdRydwHistoricalDataDto dto) {

        ResponsePage<DwdRydwHistoricalDataVo> page = dwdRydwService.selectHistoricalDataList(pageQuery,dto);

        return R.ok(page);
    }


    @GetMapping("monitoring")
    @ApiOperation("pc-人员定位-实时监测")
    public R<CompanyMonitoringVo> monitoringNumber(@ApiParam("公司编码") String companyCode, @ApiParam("煤矿编码") String mineCode) {
        CompanyMonitoringVo vo = dwdRydwService.monitoring(companyCode,mineCode);
        return R.ok(vo);
    }
    @GetMapping("shaftMonitoring")
    @ApiOperation("pc-人员定位-井下实时监测")
    public R<List<MinePersonDataDto>> shaftMonitoring(@ApiParam("公司编码") String companyCode, @ApiParam("煤矿编码") String mineCode) {
        List<MinePersonDataDto> vo = dwdRydwService.shaftMonitoring(companyCode,mineCode);
        return R.ok(vo);
    }
    @GetMapping("todayAlarm")
    @ApiOperation("pc-人员定位-今日报警")
    public R<TodayAlarmVo> todayAlarm(@ApiParam("公司编码") String companyCode, @ApiParam("煤矿编码") String mineCode) {
        TodayAlarmVo vo = dwdRydwService.todayAlarm(companyCode,mineCode);
        return R.ok(vo);
    }
    @GetMapping("changeTrendOfOvermannedMine")
    @ApiOperation("pc-人员定位-超员矿井变化趋势")
    public R<PointDateListVo> changeTrendOfOvermannedMine(@ApiParam("公司编码") String companyCode, @ApiParam("煤矿编码") String mineCode, @ApiParam(value = "月|周") String type) {
        PointDateListVo vo = dwdRydwService.changeTrendOfOvermannedMine(companyCode,mineCode,type);
        return R.ok(vo);
    }
    @GetMapping("changeTrendOfUndergroundPersonnel")
    @ApiOperation("pc-人员定位-井下人员变化趋势")
    public R<PointDateListVo> changeTrendOfUndergroundPersonnel(@ApiParam("公司编码") String companyCode,@ApiParam("煤矿编码") String mineCode,@ApiParam(value = "月|周") String type) {
        PointDateListVo vo = dwdRydwService.changeTrendOfUndergroundPersonnel(companyCode,mineCode,type);
        return R.ok(vo);
    }
}
